import {
	fetch
} from "./fetch.js"
export let ApiGetHomeData = () => fetch('/index/index', {}, {}, 'GET')
export let login = (parmas) => fetch('/auth/loginByWeb', parmas, {}, 'POST')
export const ApiLogin = (username, pwd) => fetch('/auth/loginByWeb', {
	username: username,
	pwd: pwd,
}, {})
// 新品
export let goodsDetail = (parmas) => fetch('/goods/detail', parmas, {}, 'GET')
// 新品相关产品
export let goodsRelated = (parmas) => fetch('/goods/related', parmas, {}, 'GET')


export const topicAPI = (page, size) => fetch('/topic/list', {
	page: page,
	size: size
}, {}, 'GET')

// 分类
export let ApiCatalog = () => fetch("/catalog/index", {}, {}, 'GET')

export let ApiCatalogCurrent = (parmas) => fetch("/catalog/current", parmas, {}, 'GET')

//品牌制造商 
export let ApiBrandDetail = (parmas) => fetch("/brand/detail", parmas, {}, 'GET')

export let ApiGetGoodsCategory = (params) => fetch('/goods/category', params, {}, 'GET')
export let ApiGetGoodsList = (params) => fetch('/goods/list', params, {}, 'GET')

// 搜索窗口数据
export const ApiSearch=()=>fetch('/search/index',{},{},"GET");

// 清除历史记录
export const ApiClearHistory=()=>fetch('/search/clearhistory',{},{},"POST");

// 实时搜索功能
export const ApiSearchHelper=(params)=>fetch('/search/helper',params,{},"GET");

// 搜索框商品搜查
export const ApiSearchGoods=(params)=>fetch('/goods/list',params,{},"GET");

//购物车
export let APICart = (header) => fetch('/cart/index', {}, header, "GET")

//选中与未选中
export let APICheck = (params, header) => fetch('/cart/checked', params, header, "POST")
//删除商品
export let APIdelete = (params, header) => fetch('/cart/delete', params, header, "POST")
//步进器
export let APIadd = (params, header) => fetch('/cart/update', params, header, "POST")